//-------------------------------------------------------------------
//	Copyright (c) 2013  Zhirnov Andrey
//	This file is part of the "Noise Library" project.
//	See copyright notice in "linNoiseCL.h".
//-------------------------------------------------------------------

#pragma once

#include "Common.h"

// Init //
#define UX_LIBARCHIVE_DISABLE
#define UX_ZLIB_DISABLE
#define _UXS_STD_CONSOLE_DISABLED

// Disable AL, CL, GL, DX //
//#define _DEFCFG_UXS_USE_OPENGL_DISABLED
#define _DEFCFG_UXS_USE_OPENAL_DISABLED
//#define _DEFCFG_UXS_USE_OPENCL_DISABLED
#define _DEFCFG_UXS_USE_DIRECTX11_DISABLED


#ifdef _NOISE_NO_LOG
#	define LOG_EXT( _text, _type, _file, _line )
#else
#	define LOG_EXT( _text, _level, _file, _line )	UX_STL::UXLogger::LOGGER()->WriteExt( _text, _level, _file, _line )
#endif


#define UX_REAL_TYPE_SIZE	32

#define UX_CL_BASEOBJECT_OVERRIDE \
	class _EXPORT_ CLBaseObject : protected CReferenced \
	{ \
	private: \
		CLBaseObject(const CLBaseObject &) {} \
		void operator = (const CLBaseObject &) {} \
		\
		/* Referenced */ \
		void _Release()		{ Release(); } \
		\
	public: \
		CLBaseObject() {} \
		virtual ~CLBaseObject() {} \
		virtual void Release() { delete this; } \
	}; \


#ifdef _NOISE_NO_LOG
#	define _UXS_LOGGER_H
#endif

#ifdef _NOISE_CROSS_PLATFORM
#	define _UXS_OPERATING_SYSTEM_H
//#	define _UXS_OS_TYPES_H
///#	define _UXS_SINGLETON_H

//#	undef  __UX_DEBUG__
#endif


//#	include <filesystem/ux_filesystem.h>
//#	include <ocf_parser/ux_ocf_parser.h>
	
#ifdef _NOISE_CROSS_PLATFORM

#	define _DEFCFG_UXS_USE_OPENGL_DISABLED
#	undef _UXS_USE_OPENGL

//#	include <stl_ext/OS/OSTypes.h>
#	include <stl_core/ux_stl_core.h>

#	include <stl_ext/OS/Posix/AtomicOp.h>
#	include <stl_ext/OS/Posix/SyncPrimitives.h>
#	include <stl_ext/OS/Posix/Library.h>

#	include <stl_ext/OS/Windows/AtomicOp.h>
#	include <stl_ext/OS/Windows/SyncPrimitives.h>
#	include <stl_ext/OS/Windows/Library.h>

namespace UX_STL
{
namespace UXTypesExt
{		
	typedef _platform_::SyncEvent			TEventSync;
	typedef _platform_::CriticalSection		TCriticalSection;
	typedef _platform_::Library				TLibrary;

}	// UXTypesExt
}	// UX_STL

#	include <stl_ext/Types/CReferenced.h>
//#	include <stl_ext/GL/opengl.h>

#	include <stl_ext/CL/opencl.h>
#	include <stl_ext/CL/shell/CLEnums.h>
#	include <stl_ext/CL/shell/CLCommon.h>
#	include <stl_ext/CL/shell/CLDevice.h>
#	include <stl_ext/CL/shell/CLQueue.h>
#	include <stl_ext/CL/shell/CLEvent.h>
#	include <stl_ext/CL/shell/CLProgram.h>
#	include <stl_ext/CL/shell/CLKernel.h>
#	include <stl_ext/CL/shell/CLMemory.h>
#	include <stl_ext/CL/shell/CLSampler.h>

#else

#	include <logger/ux_logger.h>
#	include <stl_ext/ux_stl_ext.h>

#endif

namespace Noise
{
	using namespace UX_STL;

	using namespace UXTypes;
	using namespace UXMath;

	using namespace CLShell;

	
#ifdef _NOISE_CROSS_PLATFORM

	struct Singleton
	{
	public:
		template <typename T>
		static T * Instance()
		{
			static T	t;
			return &t;
		}
	};

#else

	using namespace UXLogger;
	using namespace UXFileSystem;

#endif
	


}	// Noise
